package com.dong.common.mq;

import com.aliyun.openservices.ons.api.Producer;
import com.aliyun.openservices.ons.api.bean.ConsumerBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhaodongchao
 * @date 2020/11/19 15:35
 */
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(value = {Producer.class, ConsumerBean.class})
public class MQAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public MqService mqService(){
        return new MQServiceImpl();
    }
}
